<!DOCTYPE html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Тег BASE</title>
	<base target="leftFrame">
	<base href="/admin/modules/fr_left.php">	
<style type="text/css">
body, ul, menu, dir{ margin: 0px;}
#top_menu li{
	display:inline-block;
	margin: 5px;
	padding: 3px;
	border: 2px solid #CCC;
	border-radius: 5px;
	background-color: #EEE;
}
#top_menu a{
	color: #000;
	text-decoration: none;
}
</style>
</head>  
<body>
<?php
	/* массив названий модулей по именам файлов */
	$menu_translate = array(
		'content'=>'Контент',
		'service'=>'Сервис',
	);
	
	$path_modules =_DOCUMENT_ROOT.'/admin'.'/modules';
	createTopMenu( $path_modules, $menu_translate );
	
function createTopMenu( $path_modules, array $menu_translate=null ){
	if(!file_exists($path_modules)){	echo __FILE__.' line '.__LINE__.': '.Lang::get( '{FILE}_DOESNT_EXISTS', 
		array('{FILE}'=>$path_modules ) );
		return;
	} 
	$files_array = files_array( $path_modules, false, false );
	//myPrint( reset($files_array), '$files_array');
	echo '<ul id="top_menu">';
	foreach( reset($files_array) as $path=>$arr) 
		if(is_array($arr)){
			$bname = basename( $path );
			$_name = isset( $menu_translate, $menu_translate[$bname] )?$menu_translate[$bname]: $bname ;
			echo '<li><a href="?modules='.$bname.'">'.$_name.'</a>';
		}	
	echo '</ul>';
}
?>
 
</body>
</html>